package se.lnu.axez.widgets;

import se.lnu.axez.BoundingSphere;
import se.lnu.axez.ControlBase;
import se.lnu.axez.animation.RotateControlAnimation;

public final class RotatingButton extends ControlBase {
	private static final long ANIMATION_DURATION = 7000L;
	private final RotateControlAnimation rotateAnimation;
	
	public RotatingButton(int meshId, float offset) {
		super(new ButtonVisual(meshId), BoundingSphere.newInstance());
		
		this.rotateAnimation = new RotateControlAnimation();
		this.rotateAnimation.setDuration(ANIMATION_DURATION);
		this.rotateAnimation.setRepeatMode(RotateControlAnimation.REPEAT_COUNT_INFINITE);
		this.rotateAnimation.setRepeatCount(RotateControlAnimation.REPEAT_COUNT_INFINITE);
		this.rotateAnimation.setParams(offset + 360f, offset, 0f, 0f, 1f);
		this.addAnimation(rotateAnimation);
	}
	
	@Override
	protected void onClick() {
		super.onClick();
	}
}
